6.2 Signals of the Muscles and Motions

|

239

title('Force Data with Threshold and Start/End Points of Local ...

Minima')

legend ('Force under Threshold','Force Raw', 'Threshold', ...

'Local Minima Start', 'Local Minima End')

subplot(6,1,4)

plot(time_angle(1:271), local_minima_angle(1:271), 'k-')

hold on

plot(time_angle(1:271), value_angle(1:271), 'k:')

t_a(1:278,1) = threshold_angle;

plot(time_angle(1:271),t_a(1:271),'k--')

scatter(time_angle(angle_ixstart), ...

local_minima_angle(angle_ixstart), 100,....

'kx')

scatter(time_angle(angle_ixend), local_minima_angle(angle_ixend), ...

100, ...

'ko')

xlabel('Time t/s')

ylabel('Angle \alpha/deg')

title('Angle Data with Threshold and Start/End Points of Local ...

Minima')

legend ('Angle under Threshold', 'Angle Raw', 'Threshold', ...

'Local Minima Start', 'Local Minima End')

%force trigger point calculation

%get times for last and first element of local minimum

%section 2&3 and 4&5 surround the two trigger points

%extract last element of 2&4 and first 3&5

idx_force_last = time_force(force_ixend)';

idx_force_first = time_force(force_ixstart)';

%calculate trigger point 1

tp_force_1 = (idx_force_first(1,3)+idx_force_last(1,2))/2;

%calculate trigger point 2

tp_force_2 = (idx_force_first(1,5)+idx_force_last(1,4))/2;

%angle trigger point calculation

%get times for last and first element of local minimum

%section 2&3 and 3&4 surround the two trigger points

%extract last element of 1&2 and first 2&3

idx_angle_last = time_angle(angle_ixend)';

idx_angle_first = time_angle(angle_ixstart)';

%calculate trigger point 1

tp_angle_1 = (idx_angle_first(1,2)+idx_angle_last(1,1))/2;